﻿Option Strict Off
Option Explicit On
Module BS_SDK
    Public Structure BSLogRecord
        'UPGRADE_NOTE: event was upgraded to event_Renamed. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
        Dim event_Renamed As Byte
        Dim reserved1 As Byte
        Dim tnaEvent As Short
        Dim eventTime As Integer
        Dim userID As Integer
        Dim reserved2 As Integer
    End Structure

    Public Structure BSUserhdr
        Dim ID As Integer
        Dim reserved1 As Short
        Dim adminLevel As Short
        Dim securityLevel As Short
        Dim statusMask As Short
        Dim accessGroupMask As Integer
        'UPGRADE_WARNING: Fixed-length string size must fit in the buffer. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
        <VBFixedString(33), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=33)> Public username() As Char
        'UPGRADE_WARNING: Fixed-length string size must fit in the buffer. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
        <VBFixedString(33), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=33)> Public department() As Char
        'UPGRADE_WARNING: Fixed-length string size must fit in the buffer. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
        <VBFixedString(17), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst:=17)> Public password() As Char
        Dim numOfFinger As Short
        Dim duressMask As Short
        <VBFixedArray(5)> Dim checksum() As Short

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim checksum(5)
        End Sub
    End Structure

    Public Structure BSFingerprintConfig
        Dim security As Integer
        Dim userSecurity As Integer
        Dim fastMode As Integer
        Dim sensitivity As Integer
        Dim timeout As Integer
        Dim imageQuality As Integer
        Dim viewImage As Short
        <VBFixedArray(4)> Dim reserved() As Integer

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim reserved(4)
        End Sub
    End Structure


    Public Declare Function BS_InitSDK Lib "BS_SDK" () As Integer
    Public Declare Function BS_OpenSocket Lib "BS_SDK" (ByVal biostationAddr As String, ByVal port As Integer, ByRef handle As Integer) As Integer
    Public Declare Function BS_CloseSocket Lib "BS_SDK" (ByVal handle As Integer) As Integer
    Public Declare Function BS_GetBiostationID Lib "BS_SDK" (ByVal handle As Integer, ByRef biostationID As Integer) As Integer
    Public Declare Function BS_SetBiostationID Lib "BS_SDK" (ByVal handle As Integer, ByVal ID As Integer) As Integer
    'UPGRADE_WARNING: Structure BSLogRecord may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_ReadLog Lib "BS_SDK" (ByVal handle As Integer, ByVal startTime As Integer, ByVal endTime As Integer, ByRef numOfLog As Integer, ByRef logRecord As BSLogRecord) As Integer
    Public Declare Function BS_ConvertToLocalTime Lib "BS_SDK" (ByVal utcTime As Integer) As Integer

    Public Declare Function BS_ClearLogCache Lib "BS_SDK" (ByVal handle As Integer) As Integer
    'UPGRADE_WARNING: Structure BSLogRecord may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_ReadLogCache Lib "BS_SDK" (ByVal handle As Integer, ByRef numOfLog As Integer, ByRef logRecord As BSLogRecord) As Integer
    Public Declare Function BS_DeleteAllLog Lib "BS_SDK" (ByVal handle As Integer, ByVal numOfLog As Integer, ByRef numOfDeletedLog As Integer) As Integer

    Public Declare Function BS_GetUserDBInfo Lib "BS_SDK" (ByVal handle As Integer, ByRef numOfUser As Integer, ByRef numOfTemplate As Integer) As Integer
    Public Declare Function BS_Disable Lib "BS_SDK" (ByVal handle As Integer, ByVal timeout As Integer) As Integer
    Public Declare Function BS_ScanTemplate Lib "BS_SDK" (ByVal handle As Integer, ByRef template As Byte) As Integer
    'UPGRADE_WARNING: Structure BSUserhdr may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_EnrollUser Lib "BS_SDK" (ByVal handle As Integer, ByRef hdr As BSUserhdr, ByRef template As Byte) As Integer
    Public Declare Function BS_Enable Lib "BS_SDK" (ByVal handle As Integer) As Integer
    'UPGRADE_WARNING: Structure BSFingerprintConfig may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_ReadFingerprintConfig Lib "BS_SDK" (ByVal handle As Integer, ByRef config As BSFingerprintConfig) As Integer
    'UPGRADE_WARNING: Structure BSFingerprintConfig may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_WriteFingerprintConfig Lib "BS_SDK" (ByVal handle As Integer, ByRef config As BSFingerprintConfig) As Integer

    Public Declare Function BS_OpenUSBMemory Lib "BS_SDK" (ByVal driverletter As String, ByVal handle As Integer) As Integer
    Public Declare Function BS_CloseUSBMemory Lib "BS_SDK" (ByVal handle As Integer) As Integer

    Public Declare Function BS_GetTime Lib "BS_SDK" (ByVal handle As Integer, ByRef timeVal As Integer) As Integer
    Public Declare Function BS_SetTime Lib "BS_SDK" (ByVal handle As Integer, ByVal timeVal As Integer) As Integer
    Public Declare Function BS_Reset Lib "BS_SDK" (ByVal handle As Integer) As Integer
    Public Declare Function BS_UpgradeEx Lib "BS_SDK" (ByVal handle As Integer, ByVal upgradeFile As String) As Integer

    Public Declare Function BS_GetLogCount Lib "BS_SDK" (ByVal handle As Integer, ByRef numOfLog As Integer) As Integer

    Public Declare Function BS_DeleteUser Lib "BS_SDK" (ByVal handle As Integer, ByVal userID As Integer) As Integer
    Public Declare Function BS_DeleteAllUser Lib "BS_SDK" (ByVal handle As Integer) As Integer

    'UPGRADE_WARNING: Structure BSUserhdr may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_GetUser Lib "BS_SDK" (ByVal handle As Integer, ByVal userID As Integer, ByRef hdr As BSUserhdr, ByRef template As Byte) As Integer
    'UPGRADE_WARNING: Structure BSUserhdr may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_GetUserInfo Lib "BS_SDK" (ByVal handle As Integer, ByVal userID As Integer, ByRef hdr As BSUserhdr) As Integer
    'UPGRADE_WARNING: Structure BSUserhdr may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_GetAllUserInfo Lib "BS_SDK" (ByVal handle As Integer, ByRef hdr As BSUserhdr, ByRef numOfUser As Integer) As Integer
    Public Declare Function BS_ReadCardIDEx Lib "BS_SDK" (ByVal handle As Integer, ByRef cardID As UInteger, ByRef customID As Integer) As Integer

    Public Enum ServerEvent
        BS_SERVER_CB_CONN_NOAUTH = 0
        BS_SERVER_CB_CONN_SSL
        BS_SERVER_CB_CONN_LOG
        BS_SERVER_CB_DISCONN_NOAUTH
        BS_SERVER_CB_DISCONN_SSL
        BS_SERVER_CB_LOG
        KEEP_ALIVE_INTERVAL = 100
    End Enum

    'typedef BS_RET_CODE (__stdcall *BS_CallbackProc)( int handle, unsigned biostationID, int type, void* data, int dataLen );
    Public Declare Function BS_StartServerApp Lib "BS_SDK" (ByVal port As Integer, ByVal maxConnection As Integer, ByVal sslPath As String, ByVal sslPassword As String, ByVal connCheckDuration As Integer) As Integer
    Public Declare Function BS_StopServerApp Lib "BS_SDK" () As Integer
    Public Declare Function BS_SetCallback Lib "BS_SDK" (ByVal functionID As Integer, ByVal proc As Integer) As Integer
    Public Declare Function BS_IssueCertificate Lib "BS_SDK" (ByVal handle As Integer, ByVal biostationID As Integer) As Integer
    Public Declare Function BS_StartLogMonitoring Lib "BS_SDK" (ByVal handle As Integer) As Integer
    Public Declare Function BS_GetConnectedList Lib "BS_SDK" (ByVal handle As Integer, ByRef biostationList As Integer, ByRef count As Integer) As Integer
    Public Declare Function BS_CloseConnection Lib "BS_SDK" (ByVal biostationID As Integer) As Integer

    'UPGRADE_ISSUE: Declaring a parameter 'As Any' is not supported. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="FAE78A8D-8978-4FD4-8208-5B7324A8F795"'
    'UPGRADE_ISSUE: Declaring a parameter 'As Any' is not supported. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="FAE78A8D-8978-4FD4-8208-5B7324A8F795"'
    Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Int32, ByRef source As Int32, ByVal length As Integer)

    Public Declare Function lstrcpy Lib "kernel32.dll" Alias "lstrcpyA" (ByVal lpString1 As String, ByRef lpString2 As String) As Integer


    'BEPlus
    Enum BEUserValue
        'card Flag
        NORMAL_CARD = &H0S
        BYPASS_CARD = &H1S
        'card Version
        CARD_VERSION_1 = &H15S
        'Admin level
        USER_LEVEL_NORMAL = 0
        USER_LEVEL_ADMIN = 1
        'Security leve
        USER_SECURITY_DEFAULT = 0
        USER_SECURITY_LOWER = 1
        USER_SECURITY_LOW = 2
        USER_SECURITY_NORMAL = 3
        USER_SECURITY_HIGH = 4
        USER_SECURITY_HIGHER = 5
    End Enum

    Public Structure BEUserHdr
        Dim version As Integer
        Dim userID As Integer
        Dim startTime As Integer
        Dim expiryTime As Integer
        Dim cardID As Integer
        Dim cardCustomID As Byte
        Dim commandCardFlag As Byte
        Dim cardFlag As Byte
        Dim cardVersion As Byte
        Dim adminLevel As Short
        Dim securityLevel As Short
        Dim accessGroupMask As Integer
        Dim numOfFinger As Short ' 0, 1, 2
        <VBFixedArray(1)> Dim fingerChecksum() As Short
        <VBFixedArray(1)> Dim isDuress() As Byte
        Dim disabled As Integer
        Dim opMode As Integer
        Dim dualMode As Integer
        <VBFixedArray(15)> Dim password() As Byte
        <VBFixedArray(14)> Dim reserved2() As Integer

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim fingerChecksum(1)
            ReDim isDuress(1)
            ReDim password(15)
            ReDim reserved2(14)
        End Sub
    End Structure

    Enum WiegandValue
        MAX_WIEGAND_FIELD = 12
        MAX_WIEGAND_PARITY = 8
    End Enum

    Enum BS_WIEGAND_FORMAT
        BS_WIEGAND_26BIT = &H1S
        BS_WIEGAND_PASS_THRU = &H2S
        BS_WIEGAND_CUSTOM = &H3S
    End Enum

    Enum BS_WIEGAND_PARITY_TYPE
        BS_WIEGAND_EVEN_PARITY = 0
        BS_WIEGAND_ODD_PARITY = 1
    End Enum

    Public Structure BSWiegandField
        Dim bitIndex As Integer
        Dim bitLength As Integer
    End Structure

    Public Structure BSWiegandParity
        Dim bitIndex As Integer
        Dim type As BS_WIEGAND_PARITY_TYPE
        <VBFixedArray(7)> Dim bitMask() As Byte

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim bitMask(7)
        End Sub
    End Structure
    '
    Public Structure BSWiegandFormatHeader
        'UPGRADE_NOTE: format was upgraded to format_Renamed. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
        Dim format_Renamed As BS_WIEGAND_FORMAT
        Dim totalBits As Integer
    End Structure

    Public Structure BSWiegandPassThruData
        Dim numOfIDField As Integer
        <VBFixedArray(WiegandValue.MAX_WIEGAND_FIELD - 1)> Dim field() As BSWiegandField

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim field(WiegandValue.MAX_WIEGAND_FIELD - 1)
        End Sub
    End Structure

    Public Structure BSWiegandCustomData
        Dim numOfField As Integer
        Dim idFieldMask As Integer
        <VBFixedArray(WiegandValue.MAX_WIEGAND_FIELD - 1)> Dim field() As BSWiegandField
        Dim numOfParity As Integer
        'UPGRADE_WARNING: Array parity may need to have individual elements initialized. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B97B714D-9338-48AC-B03F-345B617E2B02"'
        <VBFixedArray(WiegandValue.MAX_WIEGAND_PARITY - 1)> Dim parity() As BSWiegandParity

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim field(WiegandValue.MAX_WIEGAND_FIELD - 1)
            ReDim parity(WiegandValue.MAX_WIEGAND_PARITY - 1)
        End Sub
    End Structure

    Public Structure BSWiegandFormatData
        'passThruData As BSWiegandPassThruData
        'UPGRADE_WARNING: Arrays in structure customData may need to be initialized before they can be used. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="814DF224-76BD-4BB4-BFFB-EA359CB9FC48"'
        Dim customData As BSWiegandCustomData

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            customData.Initialize()
        End Sub
    End Structure


    Public Structure BSWiegandConfig
        Dim outWidth As Integer
        Dim outInterval As Integer
        Dim header As BSWiegandFormatHeader
        Dim data As BSWiegandFormatData
        <VBFixedArray(WiegandValue.MAX_WIEGAND_FIELD - 1)> Dim fieldValue() As Integer

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            data.Initialize()
            ReDim fieldValue(WiegandValue.MAX_WIEGAND_FIELD - 1)
        End Sub
    End Structure



    Enum IOValue
        'device id
        BS_DEVICE_PRIMARY = &H0S
        BS_DEVICE_SECONDARY = &H1S
        BS_DEVICE_SECUREIO0 = &H2S
        BS_DEVICE_SECUREIO1 = &H3S
        BS_DEVICE_SECUREIO2 = &H4S
        BS_DEVICE_SECUREIO3 = &H5S
        BS_DEVICE_ALL = &HFFS
        'input port id
        BS_PORT_INPUT0 = &H0S
        BS_PORT_INPUT1 = &H1S
        BS_PORT_INPUT2 = &H2S
        BS_PORT_INPUT3 = &H3S
        BS_PORT_TAMPER = &H4S
        'relay id
        BS_PORT_RELAY0 = &H0S
        BS_PORT_RELAY1 = &H1S
        'relay
        RELAY_DISABLED = &HFFFFS
        PRIMARY_RELAY = (IOValue.BS_DEVICE_PRIMARY * (2 ^ 8)) Or IOValue.BS_PORT_RELAY0
        SECONDARY_RELAY = (IOValue.BS_DEVICE_SECONDARY * (2 ^ 8)) Or IOValue.BS_PORT_RELAY0
        SECUREIO0_RELAY0 = (IOValue.BS_DEVICE_SECUREIO0 * (2 ^ 8)) Or IOValue.BS_PORT_RELAY0
        SECUREIO0_RELAY1 = (IOValue.BS_DEVICE_SECUREIO0 * (2 ^ 8)) Or IOValue.BS_PORT_RELAY1
        SECUREIO1_RELAY0 = (IOValue.BS_DEVICE_SECUREIO1 * (2 ^ 8)) Or IOValue.BS_PORT_RELAY0
        SECUREIO1_RELAY1 = (IOValue.BS_DEVICE_SECUREIO1 * (2 ^ 8)) Or IOValue.BS_PORT_RELAY1
        SECUREIO2_RELAY0 = (IOValue.BS_DEVICE_SECUREIO2 * (2 ^ 8)) Or IOValue.BS_PORT_RELAY0
        SECUREIO2_RELAY1 = (IOValue.BS_DEVICE_SECUREIO2 * (2 ^ 8)) Or IOValue.BS_PORT_RELAY1
        SECUREIO3_RELAY0 = (IOValue.BS_DEVICE_SECUREIO3 * (2 ^ 8)) Or IOValue.BS_PORT_RELAY0
        SECUREIO3_RELAY1 = (IOValue.BS_DEVICE_SECUREIO3 * (2 ^ 8)) Or IOValue.BS_PORT_RELAY1
        'RTE
        PRIMARY_INPUT0 = (IOValue.BS_DEVICE_PRIMARY * (2 ^ 8)) Or IOValue.BS_PORT_INPUT0
        SECONDARY_INPUT0 = (IOValue.BS_DEVICE_SECONDARY * (2 ^ 8)) Or IOValue.BS_PORT_INPUT0
        SECUREIO0_RTE0 = (IOValue.BS_DEVICE_SECUREIO0 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT0
        SECUREIO0_RTE1 = (IOValue.BS_DEVICE_SECUREIO0 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT2
        SECUREIO1_RTE0 = (IOValue.BS_DEVICE_SECUREIO1 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT0
        SECUREIO1_RTE1 = (IOValue.BS_DEVICE_SECUREIO1 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT2
        SECUREIO2_RTE0 = (IOValue.BS_DEVICE_SECUREIO2 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT0
        SECUREIO2_RTE1 = (IOValue.BS_DEVICE_SECUREIO2 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT2
        SECUREIO3_RTE0 = (IOValue.BS_DEVICE_SECUREIO3 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT0
        SECUREIO3_RTE1 = (IOValue.BS_DEVICE_SECUREIO3 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT2
        'Door Sensor
        PRIMARY_INPUT1 = (IOValue.BS_DEVICE_PRIMARY * (2 ^ 8)) Or IOValue.BS_PORT_INPUT1
        SECONDARY_INPUT1 = (IOValue.BS_DEVICE_SECONDARY * (2 ^ 8)) Or IOValue.BS_PORT_INPUT1
        SECUREIO0_DOOR_SENSOR0 = (IOValue.BS_DEVICE_SECUREIO0 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT1
        SECUREIO0_DOOR_SENSOR1 = (IOValue.BS_DEVICE_SECUREIO0 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT3
        SECUREIO1_DOOR_SENSOR0 = (IOValue.BS_DEVICE_SECUREIO1 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT1
        SECUREIO1_DOOR_SENSOR1 = (IOValue.BS_DEVICE_SECUREIO1 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT3
        SECUREIO2_DOOR_SENSOR0 = (IOValue.BS_DEVICE_SECUREIO2 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT1
        SECUREIO2_DOOR_SENSOR1 = (IOValue.BS_DEVICE_SECUREIO2 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT3
        SECUREIO3_DOOR_SENSOR0 = (IOValue.BS_DEVICE_SECUREIO3 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT1
        SECUREIO3_DOOR_SENSOR1 = (IOValue.BS_DEVICE_SECUREIO3 * (2 ^ 8)) Or IOValue.BS_PORT_INPUT3
        'Open Event
        ALL_EVENT = &H0S
        AUTH_ONLY = &H1S
        TNA_ONLY = &H2S
        AUTH_N_TNA = &H3S
        'Door/switch type
        NORMALLY_OPEN = &H0S
        NORMALLY_CLOSED = &H1S
        'Reader
        NO_READER = &H0S
        PRIMARY_READER = &H1S
        SECONDARY_READER = &H2S
        MAX_DOOR = 2
        'Door mode
        NO_DOOR = 0
        ONE_DOOR = 1
        TWO_DOOR = 2
        disabled = &H0S
        GENERIC_INPUT = &H1S
        EMERGENCY_OPEN = &H2S
        ALL_ALARM_OFF = &H3S
        RESET_READER = &H4S
        LOCK_READER = &H5S
        '16 bit event ID
        AUTH_SUCCESS = &H1S
        AUTH_FAIL = &H2S
        AUTH_DURESS = &H3S
        ANTI_PASSBACK_FAIL = &H4S
        ACCESS_NOT_GRANTED = &H5S
        ENTRANCE_LIMITATION = &H6S
        ADMIN_AUTH_SUCCESS = &H7S
        TAMPER_ON = &H30S
        DOOR_OPEN = &H31S
        DOOR_CLOSED = &H32S
        DOOR_FORCED_OPEN = &H33S
        DOOR_HELD_OPEN_WARNING = &H34S
        INPUT0_ON = &H60S
        INPUT1_ON = &H61S
        INPUT2_ON = &H62S
        INPUT3_ON = &H63S
        NUM_OF_HOST_INPUT = 2
        NUM_OF_SECURE_IO = 4
        NUM_OF_SECURE_INPUT = 4
        NUM_OF_SLAVE_INPUT = 2
        MAX_OUTPUT = 200 - 16
    End Enum

    Public Structure BSDoor
        Dim realy As Integer
        Dim useRTE As Integer
        Dim useDoorSensor As Integer
        Dim openEvent As Integer
        Dim opentime As Integer
        Dim heldOpenTime As Integer
        Dim forcedOpenSchedule As Integer
        Dim forcedCloseSchedule As Integer
        Dim RTEType As Integer
        Dim sensorType As Integer
        <VBFixedArray(1)> Dim reader() As Short
        Dim useRTEEx As Byte
        Dim useSoundForcedOpen As Byte
        Dim useSoundHeldOpen As Byte
        Dim openOnce As Byte
        Dim RTE As Integer
        Dim useDoorSensorEx As Byte
        Dim alarmStatus As Byte
        <VBFixedArray(1)> Dim reserved2() As Byte
        Dim doorSensor As Integer
        Dim relayDeviceId As Integer

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim reader(1)
            ReDim reserved2(1)
        End Sub
    End Structure


    Public Structure BSDoorConfig
        'UPGRADE_WARNING: Array door may need to have individual elements initialized. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B97B714D-9338-48AC-B03F-345B617E2B02"'
        <VBFixedArray(1)> Dim door() As BSDoor
        Dim apbType As Integer
        Dim apbResetTime As Integer
        Dim doorMode As Integer

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim door(1)
        End Sub
    End Structure


    Public Structure BSInputFunction
        Dim functionType As Integer
        Dim minimumDuration As Short
        Dim switchType As Short
        Dim timeSchedule As Integer
        Dim deviceID As Integer
        <VBFixedArray(3)> Dim reserved() As Integer

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim reserved(3)
        End Sub
    End Structure


    Public Structure BSOutputEvent
        'UPGRADE_NOTE: event was upgraded to event_Renamed. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
        Dim event_Renamed As Integer
        Dim outputDeviceID As Byte
        Dim outputRelayID As Byte
        Dim relayOn As Byte
        Dim reserved1 As Byte
        Dim delay As Short
        Dim high As Short
        Dim low As Short
        Dim count As Short
        Dim priority As Integer
        Dim deviceID As Integer
        Dim outputType As Integer
        Dim reserved2 As Integer
    End Structure

    Public Structure BSEMOutputEvent
        Dim inputType As Short
        Dim outputRelayID As Short
        Dim inputDuration As Short
        Dim high As Short
        Dim low As Short
        Dim count As Short
        <VBFixedArray(4)> Dim reserved3() As Integer

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim reserved3(4)
        End Sub
    End Structure


    Public Structure BSInputConfig
        'host inputs
        'UPGRADE_WARNING: Arrays in structure hostTamper may need to be initialized before they can be used. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="814DF224-76BD-4BB4-BFFB-EA359CB9FC48"'
        Dim hostTamper As BSInputFunction
        'UPGRADE_WARNING: Array hostInput may need to have individual elements initialized. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B97B714D-9338-48AC-B03F-345B617E2B02"'
        <VBFixedArray(IOValue.NUM_OF_HOST_INPUT - 1)> Dim hostInput() As BSInputFunction
        'secure I/O
        'UPGRADE_WARNING: Array secureIO may need to have individual elements initialized. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B97B714D-9338-48AC-B03F-345B617E2B02"'
        <VBFixedArray(IOValue.NUM_OF_SECURE_IO - 1, IOValue.NUM_OF_SECURE_INPUT - 1)> Dim secureIO(,) As BSInputFunction
        'slave
        'UPGRADE_WARNING: Arrays in structure slaveTamper may need to be initialized before they can be used. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="814DF224-76BD-4BB4-BFFB-EA359CB9FC48"'
        Dim slaveTamper As BSInputFunction
        'UPGRADE_WARNING: Array slaveInput may need to have individual elements initialized. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B97B714D-9338-48AC-B03F-345B617E2B02"'
        <VBFixedArray(IOValue.NUM_OF_SLAVE_INPUT - 1)> Dim slaveInput() As BSInputFunction
        <VBFixedArray(31)> Dim reserved() As Integer

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            hostTamper.Initialize()
            ReDim hostInput(IOValue.NUM_OF_HOST_INPUT - 1)
            ReDim secureIO(IOValue.NUM_OF_SECURE_IO - 1, IOValue.NUM_OF_SECURE_INPUT - 1)
            slaveTamper.Initialize()
            ReDim slaveInput(IOValue.NUM_OF_SLAVE_INPUT - 1)
            ReDim reserved(31)
        End Sub
    End Structure


    Public Structure BSOutputConfig
        Dim numOfEvent As Integer
        <VBFixedArray(IOValue.MAX_OUTPUT - 1)> Dim outputEvent() As BSOutputEvent
        'UPGRADE_WARNING: Array emergencyEvent may need to have individual elements initialized. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B97B714D-9338-48AC-B03F-345B617E2B02"'
        <VBFixedArray(IOValue.NUM_OF_SECURE_IO - 1, IOValue.NUM_OF_SECURE_INPUT - 1)> Dim emergencyEvent(,) As BSEMOutputEvent
        <VBFixedArray(30)> Dim reserved() As Integer

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim outputEvent(IOValue.MAX_OUTPUT - 1)
            ReDim emergencyEvent(IOValue.NUM_OF_SECURE_IO - 1, IOValue.NUM_OF_SECURE_INPUT - 1)
            ReDim reserved(30)
        End Sub
    End Structure


    Enum BEConfigValue
        VALID_MAGIC_NO = &H1F2F3F00
        CONFIG_V01 = &H1S
        MAX_OPMODE = &H4S
        MAX_COMMAND_CARD = 16
        MAX_485_DEVICE = 8
        MAX_485_SECURE_IO = 4
        ' entrance type
        BI_READER = 0
        IN_READER = 1
        OUT_READER = 2
        'operation mode
        CARD_OR_FINGER = 0
        CARD_N_FINGER = 1
        CARD_ONLY = 2
        FINGER_ONLY = 3
        disabled = 4
        'security level
        AUTOMATIC_NORMAL = &H0S
        AUTOMATIC_SECURE = &H1S
        AUTOMATIC_MORE_SECURE = &H2S
        'fast mode
        FAST_MODE_AUTO = &H0S
        FAST_MODE_NORMAL = &H1S
        FAST_MODE_FAST = &H2S
        FAST_MODE_FASTER = &H3S
        'serial mode
        SERIAL_DISABLED = &H0S
        SERIAL_IO_PRIMARY = &H1S
        SERIAL_IO_SECONDARY = &H2S
        SERIAL_HOST = &H3S
        'serial baudrate
        BAUDRATE_115200 = 0
        BAUDRATE_57600 = 1
        BAUDRATE_38400 = 2
        BAUDRATE_19200 = 3
        BAUDRATE_9600 = 4
        'tna mode
        TNA_NONE = &H0S
        TNA_FIX_IN = &H1S
        TNA_FIX_OUT = &H2S
        TNA_AUTO = &H3S
        'default access group
        DEFAULT_NO_ACCESS = &H0S
        DEFAULT_FULL_ACCESS = &H1S
        BEPLUS_CONFIG = &H50S
        MAX_ARG = 3
        'LED color
        RED = 0
        YELLOW = 1
        GREEN = 2
        CYAN = 3
        BLUE = 4
        MAGENTA = 5
        WHITE = 6
        FADEOUT = &H1000000
        HIGH_FREQ = 3136
        MIDDLE_FREQ = 2637
        LOW_FREQ = 2093
        MAX_SIGNAL = 48
        STATUS_NORMAL = &H0S
        STATUS_LOCKED
        STATUS_TAMPER_ON
        STATUS_RTC_ERROR
        STATUS_WAITING_INPUT
        SCAN_FINGER = &HCS
        SCAN_CARD
    End Enum

    Public Structure BEOutputPattern
        Dim repeat As Integer ' 0: indefinite, -1: don't user
        <VBFixedArray(BEConfigValue.MAX_ARG - 1)> Dim arg() As Integer 'color for LED, frequency for Buzzer, -1 for last
        <VBFixedArray(BEConfigValue.MAX_ARG - 1)> Dim high() As Short
        <VBFixedArray(BEConfigValue.MAX_ARG - 1)> Dim low() As Short

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim arg(BEConfigValue.MAX_ARG - 1)
            ReDim high(BEConfigValue.MAX_ARG - 1)
            ReDim low(BEConfigValue.MAX_ARG - 1)
        End Sub
    End Structure


    Public Structure BELEDBuzzerConfig
        <VBFixedArray(3)> Dim reserved() As Integer
        'UPGRADE_WARNING: Array ledPattern may need to have individual elements initialized. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B97B714D-9338-48AC-B03F-345B617E2B02"'
        <VBFixedArray(BEConfigValue.MAX_SIGNAL - 1)> Dim ledPattern() As BEOutputPattern
        'UPGRADE_WARNING: Array buzzerPattern may need to have individual elements initialized. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B97B714D-9338-48AC-B03F-345B617E2B02"'
        <VBFixedArray(BEConfigValue.MAX_SIGNAL - 1)> Dim buzzerPattern() As BEOutputPattern
        <VBFixedArray(BEConfigValue.MAX_SIGNAL - 1)> Dim signalReserved() As Short

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim reserved(3)
            ReDim ledPattern(BEConfigValue.MAX_SIGNAL - 1)
            ReDim buzzerPattern(BEConfigValue.MAX_SIGNAL - 1)
            ReDim signalReserved(BEConfigValue.MAX_SIGNAL - 1)
        End Sub
    End Structure


    Public Structure BECommandCard
        Dim cardID As Integer
        Dim customID As Byte
        Dim commandType As Byte
        Dim needAdminFinger As Byte
        Dim reserved As Byte
        Dim fullCardCustomID As Integer
    End Structure


    Public Structure BEConfigData
        'header
        Dim magicNo As Integer
        Dim version As Integer
        Dim timestamp As Integer
        Dim checksum As Integer
        <VBFixedArray(3)> Dim headerReserved() As Integer
        'operation mode
        <VBFixedArray(3)> Dim opMode() As Integer
        <VBFixedArray(3)> Dim opModeSchedule() As Integer
        <VBFixedArray(3)> Dim opDualMode() As Byte
        Dim opModePerUser As Integer
        <VBFixedArray(6)> Dim opReserved() As Integer
        'ip
        Dim useDHCP As Byte
        Dim ipAddr As Integer
        Dim gateway As Integer
        Dim subnetMask As Integer
        Dim serverIpAddr As Integer
        Dim port As Integer
        Dim useServer As Byte
        Dim synchTime As Byte
        Dim support100BaseT As Integer
        <VBFixedArray(6)> Dim ipReserved() As Integer
        'fingerprint
        Dim securityLevel As Integer
        Dim fastMode As Integer
        Dim fingerReserved1 As Integer
        Dim timeout As Integer '1 ~ 20 sec
        Dim matchTimeout As Integer 'Infinite(0) ~ 10 sec
        Dim templateType As Integer
        Dim fakeDetection As Integer
        Dim useServerMatching As Byte
        <VBFixedArray(7)> Dim fingerReserved() As Integer
        'I/O
        'UPGRADE_WARNING: Arrays in structure inputConfig may need to be initialized before they can be used. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="814DF224-76BD-4BB4-BFFB-EA359CB9FC48"'
        Dim inputConfig As BSInputConfig
        'UPGRADE_WARNING: Arrays in structure outputConfig may need to be initialized before they can be used. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="814DF224-76BD-4BB4-BFFB-EA359CB9FC48"'
        Dim outputConfig As BSOutputConfig
        'UPGRADE_WARNING: Arrays in structure doorConfig may need to be initialized before they can be used. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="814DF224-76BD-4BB4-BFFB-EA359CB9FC48"'
        Dim doorConfig As BSDoorConfig
        <VBFixedArray(2)> Dim ioReserved() As Integer
        'extended serial
        Dim hostID As Integer
        <VBFixedArray(BEConfigValue.MAX_485_DEVICE - 1)> Dim slaveIDEx() As Integer
        Dim slaveType As Integer
        'serial
        Dim serialMode As Integer
        Dim serialBaudrate As Integer
        Dim serialReserved1 As Byte
        Dim secureIO As Byte '// 0x01 - Secure I/O 0, 0x02 - Secure I/O 1, 0x04, 0x08
        Dim useTermination As Byte
        <VBFixedArray(4)> Dim serialReserved2() As Byte
        Dim slaveID As Integer
        <VBFixedArray(16)> Dim reserved1() As Integer
        'entrance limit
        Dim minEntryInterval As Integer
        Dim numOfEntranceLimit As Integer
        <VBFixedArray(3)> Dim maxEntry() As Integer
        <VBFixedArray(3)> Dim entryLimitInterval() As Integer
        Dim bypassGroupId As Integer
        <VBFixedArray(6)> Dim entranceLimitReserved() As Integer
        'command card
        Dim numOfCommandCard As Integer
        <VBFixedArray(BEConfigValue.MAX_COMMAND_CARD - 1)> Dim commandCard() As BECommandCard
        <VBFixedArray(2)> Dim commandCardReserved() As Integer
        'tna
        Dim tnaMode As Integer
        Dim autoInSchedule As Integer
        Dim autoOutSchedule As Integer
        <VBFixedArray(4)> Dim tnaReserved() As Integer
        'user
        Dim defaultAG As Integer
        <VBFixedArray(6)> Dim userReserved() As Integer
        <VBFixedArray(20)> Dim reserved2() As Integer
        Dim isLocked As Integer
        'wiegand
        Dim useWiegandOutput As Byte
        Dim useWiegandInput As Integer
        Dim wiegandMode As Integer
        Dim wiegandReaderID As Integer
        <VBFixedArray(2)> Dim wiegandReserved() As Integer
        Dim wiegandIdType As Integer
        'UPGRADE_WARNING: Arrays in structure wiegandConfig may need to be initialized before they can be used. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="814DF224-76BD-4BB4-BFFB-EA359CB9FC48"'
        Dim wiegandConfig As BSWiegandConfig
        'LED/Buzzer
        'UPGRADE_WARNING: Arrays in structure ledBuzzerConfig may need to be initialized before they can be used. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="814DF224-76BD-4BB4-BFFB-EA359CB9FC48"'
        Dim ledBuzzerConfig As BELEDBuzzerConfig
        <VBFixedArray(37)> Dim reserved3() As Integer
        Dim cardIdFormatType As Integer 'CARD_ID_FORMAT_NORMAL, CARD_ID_FORMAT_WIEGAND
        Dim cardIdByteOrde As Integer 'CARD_ID_MSB, CARD_ID_LSB
        Dim cardIdBitOrde As Integer 'CARD_ID_MSB, CARD_ID_LSB
        <VBFixedArray(173)> Dim padding() As Integer

        'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
        Public Sub Initialize()
            ReDim headerReserved(3)
            ReDim opMode(3)
            ReDim opModeSchedule(3)
            ReDim opDualMode(3)
            ReDim opReserved(6)
            ReDim ipReserved(6)
            ReDim fingerReserved(7)
            inputConfig.Initialize()
            outputConfig.Initialize()
            doorConfig.Initialize()
            ReDim ioReserved(2)
            ReDim slaveIDEx(BEConfigValue.MAX_485_DEVICE - 1)
            ReDim serialReserved2(4)
            ReDim reserved1(16)
            ReDim maxEntry(3)
            ReDim entryLimitInterval(3)
            ReDim entranceLimitReserved(6)
            ReDim commandCard(BEConfigValue.MAX_COMMAND_CARD - 1)
            ReDim commandCardReserved(2)
            ReDim tnaReserved(4)
            ReDim userReserved(6)
            ReDim reserved2(20)
            ReDim wiegandReserved(2)
            wiegandConfig.Initialize()
            ledBuzzerConfig.Initialize()
            ReDim reserved3(37)
            ReDim padding(173)
        End Sub
    End Structure

    Public Declare Function BS_OpenInternalUDP Lib "BS_SDK" (ByRef handle As Integer) As Integer
    Public Declare Function BS_CloseInternalUDP Lib "BS_SDK" (ByVal handle As Integer) As Integer
    Public Declare Function BS_SearchDeviceInLAN Lib "BS_SDK" (ByVal handle As Integer, ByRef numOfDevice As Integer, ByRef deviceIDs As Integer, ByRef deviceTypes As Integer, ByRef readerAddrs As Integer) As Integer
    Public Declare Function BS_ChangePasswordBEPlus Lib "BS_SDK" (ByVal handle As Integer, ByRef oldPassword As Byte, ByRef newPassword As Byte) As Integer
    Public Declare Function BS_GetDeviceID Lib "BS_SDK" (ByVal handle As Integer, ByRef deviceID As Integer, ByRef deviceType As Integer) As Integer
    Public Declare Function BS_SearchDevice Lib "BS_SDK" (ByVal handle As Integer, ByRef deviceIDs As Integer, ByRef deviceTypes As Integer, ByRef numOfReader As Integer) As Integer
    Public Declare Function BS_SetDeviceID Lib "BS_SDK" (ByVal handle As Integer, ByVal deviceID As Integer, ByVal deviceType As Integer) As Integer

    'UPGRADE_WARNING: Structure BEUserHdr may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_EnrollUserBEPlus Lib "BS_SDK" (ByVal handle As Integer, ByRef hdr As BEUserHdr, ByRef templateData As Byte) As Integer
    'UPGRADE_WARNING: Structure BEUserHdr may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_EnrollMultipleUserBEPlus Lib "BS_SDK" (ByVal handle As Integer, ByVal numOfUser As Integer, ByRef hdr As BEUserHdr, ByRef templateData As Byte) As Integer 'max 64 user
    'UPGRADE_WARNING: Structure BEUserHdr may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_GetUserBEPlus Lib "BS_SDK" (ByVal handle As Integer, ByVal userID As Integer, ByRef hdr As BEUserHdr, ByRef templateData As Byte) As Integer
    'UPGRADE_WARNING: Structure BEUserHdr may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_GetUserInfoBEPlus Lib "BS_SDK" (ByVal handle As Integer, ByVal userID As Integer, ByRef hdr As BEUserHdr) As Integer
    'UPGRADE_WARNING: Structure BEUserHdr may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_GetAllUserInfoBEPlus Lib "BS_SDK" (ByVal handle As Integer, ByRef hdr As BEUserHdr, ByRef numOfUser As Integer) As Integer

    Public Declare Function BS_AddCommandCard Lib "BS_SDK" (ByVal cardID As Integer, ByVal customID As Byte, ByVal cardType As Integer) As Integer
    Public Declare Function BS_DeleteCommandCard Lib "BS_SDK" (ByVal cardID As Integer, ByVal customID As Byte) As Integer
    Public Declare Function BS_DeleteAllCommandCard Lib "BS_SDK" () As Integer
    'UPGRADE_WARNING: Structure BEConfigData may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_WriteConfig Lib "BS_SDK" (ByVal handle As Integer, ByVal configType As Integer, ByVal size As Integer, ByRef data As BEConfigData) As Integer
    'UPGRADE_WARNING: Structure BEConfigData may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_ReadConfig Lib "BS_SDK" (ByVal handle As Integer, ByVal configType As Integer, ByRef size As Integer, ByRef data As BEConfigData) As Integer

    Public Declare Function inet_addr Lib "ws2_32" (ByRef Addr As Byte) As Integer

    Public Declare Function BS_ResetUDP Lib "BS_SDK" (ByVal handle As Integer, ByVal Addr As Integer, ByVal deviceID As Integer) As Integer
    'UPGRADE_WARNING: Structure BEConfigData may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_WriteConfigUDP Lib "BS_SDK" (ByVal handle As Integer, ByVal targetAddr As Integer, ByVal targetID As Integer, ByVal configType As Integer, ByVal dataSize As Integer, ByRef configData As BEConfigData) As Integer
    'UPGRADE_WARNING: Structure BEConfigData may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
    Public Declare Function BS_ReadConfigUDP Lib "BS_SDK" (ByVal handle As Integer, ByVal targetAddr As Integer, ByVal targetID As Integer, ByVal configType As Integer, ByRef dataSize As Integer, ByRef configData As BEConfigData) As Integer
    Public Declare Function BS_FactoryDefault Lib "BS_SDK" (ByVal handle As Integer, ByVal mask As Integer) As Integer
End Module
